/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.eps.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Diana
 */
@Embeddable
public class DetalleInventarioPK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @Column(name = "codInventario")
    private String codInventario;
    @Basic(optional = false)
    @Column(name = "id_suministro")
    private String idSuministro;
    @Basic(optional = false)
    @Column(name = "id_casilla")
    private int idCasilla;
    @Basic(optional = false)
    @Column(name = "id_empresa")
    private String idEmpresa;

    public DetalleInventarioPK() {
    }

    public DetalleInventarioPK(String codInventario, String idSuministro, int idCasilla, String idEmpresa) {
        this.codInventario = codInventario;
        this.idSuministro = idSuministro;
        this.idCasilla = idCasilla;
        this.idEmpresa = idEmpresa;
    }

    public String getCodInventario() {
        return codInventario;
    }

    public void setCodInventario(String codInventario) {
        this.codInventario = codInventario;
    }

    public String getIdSuministro() {
        return idSuministro;
    }

    public void setIdSuministro(String idSuministro) {
        this.idSuministro = idSuministro;
    }

    public int getIdCasilla() {
        return idCasilla;
    }

    public void setIdCasilla(int idCasilla) {
        this.idCasilla = idCasilla;
    }

    public String getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(String idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codInventario != null ? codInventario.hashCode() : 0);
        hash += (idSuministro != null ? idSuministro.hashCode() : 0);
        hash += (int) idCasilla;
        hash += (idEmpresa != null ? idEmpresa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleInventarioPK)) {
            return false;
        }
        DetalleInventarioPK other = (DetalleInventarioPK) object;
        if ((this.codInventario == null && other.codInventario != null) || (this.codInventario != null && !this.codInventario.equals(other.codInventario))) {
            return false;
        }
        if ((this.idSuministro == null && other.idSuministro != null) || (this.idSuministro != null && !this.idSuministro.equals(other.idSuministro))) {
            return false;
        }
        if (this.idCasilla != other.idCasilla) {
            return false;
        }
        if ((this.idEmpresa == null && other.idEmpresa != null) || (this.idEmpresa != null && !this.idEmpresa.equals(other.idEmpresa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.DetalleInventarioPK[codInventario=" + codInventario + ", idSuministro=" + idSuministro + ", idCasilla=" + idCasilla + ", idEmpresa=" + idEmpresa + "]";
    }

}
